package untils

import (
	"fmt"
	"srv/pkg"
)

type SendSms interface {
	SendSms(mobile string, code string) error
}

type AliYunSms struct { //阿里云短信

}

func (a *AliYunSms) SendSms(mobile string, code string) error {
	sms, err := pkg.SendSms(mobile, code)
	if err != nil {
		return err
	}
	if *sms.Body.Code != "OK" {
		return fmt.Errorf(*sms.Body.Message)
	}
	return nil
}

type HuYiSms struct { //阿里云短信

}

func (a *HuYiSms) SendSms(mobile string, code string) error {
	return nil
}

type MessageSms struct { //阿里云短信

}

func (a *MessageSms) SendSms(mobile string, code string) error {
	return nil
}

type name struct {
}
